package com.obtk.byproperty.controller;



import com.obtk.byproperty.dao.ComplaintMapper;
import com.obtk.byproperty.pojo.Complaint;
import com.obtk.byproperty.pojo.JsonResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import com.obtk.byproperty.service.ComplaintService;
import org.springframework.beans.factory.annotation.Autowired;


@RestController
@RequestMapping("/complaint")
public class ComplaintController {

    @Autowired
    private ComplaintService complaintService;

    @RequestMapping("/addComplaint")
    public JsonResult addComplaint(Complaint complaint){
        System.out.println(complaint);
        boolean add = complaintService.add(complaint);
        if(add){
           return JsonResult.success(complaint).put("code",1).put("msg","反馈成功");
       }
       return JsonResult.fail(null).put("code",0).put("msg","反馈失败");
    }


}
